home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / utility / 516 / orctoolb / tools2.doc < prev    next >
Encoding:
Text File  |  1991-03-08  |  5.5 KB  |  135 lines

  1.             Orc's collection of tiny-little
  2.             utilities of limited value unless
  3.             you run your ST via a shell in
  4.             the auto folder. Part 2
  5.  
  6.     These programs are released to the public domain.  You may do anything
  7.     you wish to them or with them.  If you modify one of the programs to
  8.     make it more useful, please release your changes to the public domain
  9.     as well.
  10.  
  11. CMP: compare two binary files
  12.     Usage: cmp [-s] file1 file2
  13.  
  14.     Cmp does a bytewise compare of two files, showing you (in dump format)
  15.     a listing of the differences between them. If it finds no differences,
  16.     it silently returns with status 0.  If there are differences, it shows
  17.     all of them and returns one of the following statuses:
  18.  
  19.         1 - cannot open file1
  20.         2 - cannot open file2
  21.         3 - file1 ends before file2
  22.         4 - file2 ends before file1
  23.  
  24.     If you specify the -s option, cmp will run silently; it will not show
  25.     any of the differences, but will return the appropriate status.  Silence
  26.     also enables two other statuses:
  27.  
  28.         3 - first different byte in file1 < file2
  29.         4 - first different byte in file2 < file1
  30.     
  31.  
  32. DEPEND: Build makefile dependency lists from grep output.
  33.     Usage: grep "^#[\s\t]*include" file [...] | depend >> makefile
  34.  
  35.     Depend is designed to sit in a pipeline with a grep -nl and generate
  36.     dependency lists of the form
  37.  
  38.     file.o: include-files file.c
  39.  
  40.     so you can better deal with generating and maintaining makefiles.
  41.     The example given for usage assumes you're running a shell that
  42.     supports i/o redirection and pipelines (like the teeny-shell); if
  43.     you don't have such a shell, you can't get depend to work, because
  44.     it takes its input from standard input and puts it output to
  45.     standard output.
  46.  
  47. GREP: Find patterns in files
  48.     Usage: grep [-cElnsv] [-] pattern [file ...]
  49.  
  50.     Grep looks for regular expression patterns in the given files (or
  51.     on standard input if there are no such patterns) and shows the lines
  52.     that contain matches. If you are searching multiple files, grep will
  53.     also tell you the file where the matching line was found. Grep also
  54.     returns a status on whether it made a match on the last file checked:
  55.  
  56.         0: found a match.
  57.         1: no matches.
  58.         2: couldn't open the file.
  59.         255: bad usage.
  60.  
  61.     The patterns grep uses are a subset of that of the Un*x utility grep;
  62.     they are:
  63.         ^:     matches the start of a line
  64.         $:     matches the end of a line
  65.         [set]: matches any character in set (for example, [abc] matches
  66.            the letter a, b, or c)
  67.         .:     matches any character.
  68.         *:     matches zero or more of the previous character (.* matches
  69.            any number of characters)
  70.         \<:    matches the beginning of an alphanumeric word.
  71.         \>:    matches the end of an alphanumeric word.
  72.         \n:    matches the newline character
  73.         \r:    matches the return character
  74.         \t:    matches the tab character
  75.         \f:    matches the formfeed character
  76.         \s:    matches a space.
  77.         \:     escapes special meaning for the following character.
  78.  
  79.         all other characters match themselves.
  80.  
  81.     For example, the pattern foo matches any line with the string foo in
  82.     it.  ^foo matches any line with foo at the start of it, and foo$ matches
  83.     any line with foo at the end of it.  [ab][cd] matches lines containing
  84.     the string ac, ad, bc, and bd.  ab* matches a, ab, abb, abbbbbb.
  85.  
  86.     Grep has a collection of options:
  87.     -c: grep will not show matching lines, but tell you how many matches
  88.         were found.
  89.     -E: Emphasis.  Shows the matching patterns in reverse video. (This is
  90.         only applicable on the ST console.)
  91.     -l: grep will not show matching lines, but will tell you the files
  92.         where it found matches.
  93.     -n: give the line number where the pattern was found.
  94.     -s: grep will be completely silent.  You may interrogate the return
  95.         status for information (like the -s option for cmp, above)
  96.     -v: only show lines that do not match the pattern.
  97.  
  98.     If you're reading from standard input, the -l option is ignored.
  99.     
  100. PRINTENV: show your current environment
  101.     Usage: printenv
  102.  
  103.     Printenv prints the contents of your environment as best as it can.
  104.     It will probably become confused with MWC ARGC= strings, and it has
  105.     troubles with 'tag' environment variables.
  106.  
  107. STIME: set the system date and time
  108.     Usage: stime HRMNDYMOYR
  109.  
  110.     Stime sets the GEMDOS and the BIOS clocks to the specified date.
  111.  
  112. STRINGS: show asciz strings in a file or standard input
  113.     Usage: strings [-lx]      - show strings in standard input
  114.        strings [-lx] file - show strings in file.
  115.  
  116.     Strings shows all strings (sequences of printable characters terminated
  117.     by a null or newline) that appear in the input stream; a string is x
  118.     (passed by the -l argument; default is 2) or more printable characters
  119.     followed by a newline or a null.
  120.  
  121. TOUCH: update modification date on a collection of files
  122.     Usage: touch [HRMNDYMO[YR]] file [file ...]
  123.  
  124.     Touch updates the modification date on a file to the current date or
  125.     a specified date. If the file does not exist, it is created and the
  126.     modification date is set to the specified date.
  127.  
  128. TEE: pipe fitting
  129.     Usage: tee file
  130.  
  131.     Tee takes its standard input and duplicates it, sending one copy to
  132.     the given file and the other copy to its standard output.  It's useful
  133.     inside of a shell pipeline for getting a archival copy of what's going
  134.     on inside that pipeline.
  135.